﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="AllSparePartApplyForms.aspx.cs" Inherits="WXYW.AllSparePartApplyForms" %>

<%@ Register Namespace="WXYW.Controls" TagPrefix="WXYWControl" Assembly="WXYW.Common" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    我的备件申请服务
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ButtonPlaceHolder" runat="server">
关键字<asp:TextBox ID="keyWordTextBox" runat="server" Height="16px" onkeypress="enterTxtBox('searchLinkButton')"></asp:TextBox><asp:LinkButton
        ID="searchLinkButton" runat="server" OnClick="searchLinkButton_Click">查询</asp:LinkButton><asp:LinkButton
            ID="resetLinkButton" runat="server" OnClick="resetLinkButton_Click">清除</asp:LinkButton>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="RightContentPlaceHolder" runat="server">
    <WXYWControl:CustomGridView ID="sparePartApplyFormsGridView" runat="server" AutoGenerateColumns="false"
        Width="100%" CssClass="tableList" BorderWidth="1" BorderColor="#888888" 
        AllowPaging="true" AllowSorting="true"
        OnMustAddARow="GridView_MustAddARow" PageSize="20" OnPageIndexChanging="sparePartApplyFormsGridView_PageIndexChanging"
        OnRowDataBound="sparePartApplyFormsGridView_RowDataBound" 
        ondatabound="sparePartApplyFormsGridView_DataBound" 
        onsorting="sparePartApplyFormsGridView_Sorting">
        <Columns>
            <asp:TemplateField HeaderImageUrl="~/image/operateicon/button_Select.gif">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="IDLbl" runat="server"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="平台" SortExpression="ServiceStation.Name">
                <ItemTemplate>
                    <%#Eval("ServiceStation.Name") %>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="流水号" DataField="Code" />
            <asp:TemplateField HeaderText="RMA#" SortExpression="ApplicationCode">
                <ItemTemplate>
                    <asp:LinkButton ID="rmalnk" runat="server" 
                        Text='<%# Bind("ApplicationProduct.ApplicationForm.ApplicationCode") %>' 
                        onclick="rmalnk_Click" CommandArgument='<%# Bind("ApplicationProduct.ApplicationForm.ApplicationID") %>'></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="型号" SortExpression="ApplicationProduct.ProductType.ProductTypeName">
                <ItemTemplate>
                    <%#Eval("ApplicationProduct.ProductType.ProductTypeName") %>
                </ItemTemplate>
            </asp:TemplateField>           
            <asp:TemplateField HeaderText="申请日期" SortExpression="ApplyTime">
                <ItemTemplate>
                    <%#Convert.ToDateTime(Eval("ApplyTime")).ToString("yyyy-MM-dd")%>
                </ItemTemplate>
            </asp:TemplateField>
             <asp:TemplateField HeaderText="平台收货日期" SortExpression="ReceiveTime">
                <ItemTemplate>
                    <%#Convert.ToDateTime(Eval("ReceiveTime")).ToString("yyyy-MM-dd")%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="工程师" SortExpression="User.ContactPerson">
                <ItemTemplate>
                    <%#Eval("User.ContactPerson")%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="状态" DataField="Status" SortExpression="Status" />
            <asp:TemplateField>
                <ItemTemplate>
                    <img src="image/operateicon/docedit.gif" />
                    <asp:LinkButton ID="updateLinkButton" runat="server" OnClick="updateLinkButton_Click"
                        CommandArgument='<%#Eval("ID") %>'>查看</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <PagerTemplate>
            本类记录<span style="color: Red"><%= RecordsNumber%></span>条, <span style="color: Red">20</span>条/页
            当前 <span style="color: Red">
                <%= sparePartApplyFormsGridView.PageIndex + 1%>/<%= sparePartApplyFormsGridView.PageCount%></span>页
            <asp:LinkButton CommandName="Page" CommandArgument="First" ID="LinkButton1" runat="server"
                Style="color: blue">首页</asp:LinkButton><asp:LinkButton CommandName="Page" CommandArgument="Prev"
                    ID="LinkButton2" runat="server" Style="color: blue">|上一页</asp:LinkButton>
            <asp:LinkButton CommandName="Page" CommandArgument="Next" ID="LinkButton3" runat="server"
                Style="color: blue">下一页</asp:LinkButton><asp:LinkButton CommandName="Page" CommandArgument="Last"
                    ID="LinkButton4" runat="server" Style="color: blue">|尾页</asp:LinkButton>
            转到<asp:DropDownList ID="pageDDL" runat="server" AutoPostBack="True" OnSelectedIndexChanged="pageDDL_SelectedIndexChanged">
            </asp:DropDownList>
        </PagerTemplate>
        <HeaderStyle ForeColor="White" Font-Bold="True" BackColor="#A55129"></HeaderStyle>
    </WXYWControl:CustomGridView>
</asp:Content>
